//
//  SingleDetailTableViewCell.m
//  MyDIYHouse
//
//  Created by dlios on 15-7-3.
//  Copyright (c) 2015年 李平洋. All rights reserved.
//

#import "SingleDetailTableViewCell.h"

#define HEIGHT [UIScreen mainScreen].bounds.size.height
#define WIDTH [UIScreen mainScreen].bounds.size.width


@implementation SingleDetailTableViewCell

- (void)dealloc {
    [_CommodityImage release];
    [_CommodityNameLabel release];
    [_dealerLabel release];
    [_dealerNameLabel release];
    [_addressLabel release];
    [_addressIntroduceLabel release];
    [_phoneLabel release];
    [_phoneNameLabel release];
    [super dealloc];
    
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        //商品图片
        self.CommodityImage = [[UIImageView alloc] init];
        //self.CommodityImage.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:self.CommodityImage];
        [_CommodityImage release];
        

        //商品名
        self.CommodityNameLabel = [[UILabel alloc] init];
        //self.CommodityNameLabel.backgroundColor = [UIColor grayColor];
        self.CommodityNameLabel.numberOfLines = 0;
        self.CommodityNameLabel.font = [UIFont systemFontOfSize:20];
        [self.contentView addSubview:self.CommodityNameLabel];
        [_CommodityNameLabel release];

        //产品介绍(前标签)
//        self.CommodityIntroduceLabel = [[UILabel alloc] init];
//        self.CommodityIntroduceLabel.backgroundColor = [UIColor greenColor];
//        self.CommodityIntroduceLabel.text = @"产品介绍:";
//        self.CommodityIntroduceLabel.font = [UIFont systemFontOfSize:14];
//        [self.contentView addSubview:self.CommodityIntroduceLabel];
//        [_CommodityIntroduceLabel release];

//        //商品参数
//        self.CommodityParameterlabel = [[UILabel alloc] init];
//        self.CommodityParameterlabel.backgroundColor = [UIColor grayColor];
//        self.CommodityParameterlabel.font = [UIFont systemFontOfSize:14];
//        [self.contentView addSubview:self.CommodityParameterlabel];
//        [_CommodityParameterlabel release];

        //经销商(前标签)
        self.dealerLabel = [[UILabel alloc] init];
        //self.dealerLabel.backgroundColor = [UIColor greenColor];
        self.dealerLabel.text = @"经销商:";
        self.dealerLabel.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:self.dealerLabel];
        [_dealerLabel release];
        
        //经销商名字
        self.dealerNameLabel = [[UILabel alloc] init];
        //self.dealerNameLabel.backgroundColor = [UIColor grayColor];
        self.dealerNameLabel.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:self.dealerNameLabel];
        [_dealerNameLabel release];

        
        //地址(前标签)
        self.addressLabel = [[UILabel alloc] init];
        //self.addressLabel.backgroundColor = [UIColor greenColor];
        self.addressLabel.text = @"地址:";
        self.addressLabel.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:self.addressLabel];
        [_addressLabel release];
        //地址(内容)
        self.addressIntroduceLabel = [[UILabel alloc] init];
        //self.addressIntroduceLabel.backgroundColor = [UIColor grayColor];
        self.addressIntroduceLabel.numberOfLines = 0;
        self.addressIntroduceLabel.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:self.addressIntroduceLabel];
        [_addressIntroduceLabel release];

        //电话(前标签)
        self.phoneLabel = [[UILabel alloc] init];
        //self.phoneLabel.backgroundColor = [UIColor greenColor];
        self.phoneLabel.text = @"电话:";
        self.phoneLabel.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:self.phoneLabel];
        [_phoneLabel release];

        //电话(内容)
        self.phoneNameLabel = [[UILabel alloc] init];
        //self.phoneNameLabel.backgroundColor = [UIColor grayColor];
        self.phoneNameLabel.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:self.phoneNameLabel];
        [_phoneNameLabel release];
    

    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.CommodityImage.frame = CGRectMake(0, 0, WIDTH, 220);
    self.CommodityNameLabel.frame = CGRectMake(10, 240, WIDTH - 20, 60);
//    self.CommodityParameterlabel.frame = CGRectMake(10, 280, WIDTH - 20 , 120);
    self.dealerLabel.frame = CGRectMake(10, 340, 50, 20);
    self.dealerNameLabel.frame = CGRectMake(61, 340, WIDTH - 80, 20);
    self.addressLabel.frame = CGRectMake(10, 380, 35, 20);
    self.addressIntroduceLabel.frame = CGRectMake(46, 370, WIDTH - 80, 40);
    self.phoneLabel.frame = CGRectMake(10, 420, 35, 20);
    self.phoneNameLabel.frame =CGRectMake(46, 420, 350, 20);
    
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
